//
//  ZYDiskCache.h
//  ZYWebImage
//
//  Created by wangzhipan on 2025/3/14.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class ZYDiskConfig;
@interface ZYDiskCache : NSCache
- (instancetype)initWithCachePath:(NSString *)cachePath
                           config:(ZYDiskConfig *)config;

- (BOOL)containDataForKey:(NSString *)key;
- (nullable NSData *)dataForKey:(NSString *)key;
- (nullable NSData *)extraDataForKey:(NSString *)key;
- (void)saveData:(nullable NSData *)data forKey:(nonnull NSString *)key;
- (void)saveExtraData:(nullable NSData *)data forKey:(nonnull NSString *)key;
- (void)removeDataForKey:(nonnull NSString *)key;
- (void)removeAllData;
- (void)removeExpiredData;
- (nullable NSString *)cachePathForKey:(nonnull NSString *)key;
- (NSUInteger)totalCount;
//return byte
- (NSUInteger)totalSize;
@end

NS_ASSUME_NONNULL_END
